def g (a):
    flag=True
    while flag:
        flag=False 
        for i in range (len(a)-1):
            if a[i]>a[i+1]:
                a[i],a[i+1]=a[i+1], a[i]
                flag= True
    return a
from time import*
t1=time()
e1=open('m1_sorted.txt').readlines()
e1=list(map(int,e1))
(g(e1))
t3=time()
e2=open('m2_reverse.txt').readlines()
e2=list(map(int,e2))
(g(e2))
t4=time()
e3=open('m3_shuffle.txt').readlines()
e3=list(map(int,e3))
(g(e3))
t2=time()
print('m1_sorted.txt',(t2-t1)*100 ,'milliseconds')
print('m2_reverse.txt' ,(t2-t3)*100, 'milliseconds')
print('m3_shuffle.txt',(t2-t4)*100 ,'milliseconds')